package com.ocom.wxapi.controller;


import com.ocom.common.request.wx.CommonRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.SearchMachListVo;
import com.ocom.wxapi.client.AccessClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@PreAuthorize("hasRole('ROLE_WX')")
@RestController
@RequestMapping("/MachListPage")
public class MachListPageController {

    @Autowired
    AccessClientService accessClientService;

    @PostMapping("/onShow")
    public Result onShow(@Valid CommonRequest request) {
        SearchMachListVo searchMachListVo=new SearchMachListVo();
        searchMachListVo.setComId(request.getCompanyId());
        searchMachListVo.setPage(0);
        searchMachListVo.setSize(0);
        return accessClientService.SearchMachList(searchMachListVo);
    }

}
